<!DOCTYPE HTML>
<html>

<head>
    <title>九金保函-APP下载</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <link rel="stylesheet" href="assets/css/main.css" />
    <noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
</head>
<style>
    html,
    body,
    #header {
        height: 100%
    }
    
    * {
        margin: 0;
        padding: 0;
    }
    
    img {
        max-width: 100%;
        height: auto;
    }
    
    .test {
        height: 600px;
        max-width: 600px;
        font-size: 40px;
    }
</style>

<body class="is-preload">
    <header id="header">
        <div class="content">
            <h1><a href="#">九金保函</a></h1>
            <p>九金保函专属APP下载</p>
            <ul class="actions">
                <li>
                    <a id="JdownApp" href="https://bl.eqbidding.com/app/jjbh.apk" class="button primary "><img style="width:20px;font-size:0;margin-right:5px;position: relative;top: 2px;" src="./images/android.png"></img>Android下载</a>
                </li>
                <li>
                    <a id="JdownApp2" href="#one" class="button primary "><img style="width:20px;font-size:0;margin-right:5px;position: relative;top: 2px;" src="./images/ios.png"></img>IOS下载</a>
                </li>
            </ul>
            <div class="wxtip" id="JweixinTip">
                <span class="wxtip-icon"></span>
                <p class="wxtip-txt" id="code"></p>
            </div>
        </div>
        <div class="image phone">
            <div class="inner"><img src="images/dg1.jpg" alt="" /></div>
        </div>
    </header>
    <script src="assets/js/jquery.min.js"></script>
    <script src="assets/js/jquery.scrolly.min.js"></script>
    <script src="https://cdn.jsdelivr.net/clipboard.js/1.5.12/clipboard.min.js"></script>
    <script src="assets/js/browser.min.js"></script>
    <script src="assets/js/breakpoints.min.js"></script>
    <script src="assets/js/util.js"></script>
    <script src="assets/js/main.js"></script>
    <script>
        //获取地址栏参数值
        var getUrlParam = function(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); // 构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg); // 匹配目标参数
            console.log(window.location)
            if (r != null) {
                return decodeURIComponent(r[2]);
            }
            return null; //返回参数值
        };


        function is_weixin() {
            var ua = navigator.userAgent.toLowerCase();
            if (ua.match(/MicroMessenger/i) == "micromessenger") {
                return true;
            } else {
                return false;
            }
        }

        function copy() {
            var clipboard = new Clipboard('#copy_btn', {
                text: function() {
                    return $("#copycode").html();
                }
            });
            clipboard.on('success', function(e) {
                alert("复制成功", 1500);
                e.clearSelection();
            });

        }

        $(function() {

            if (isWeixin) {
                $("#JdownApp").click(function(e) {
                    window.event ? window.event.returnValue = false : e.preventDefault();
                    $("#weixinTip").css("display", "block");
                });
                $("#weixinTip").click(function(e) {
                    $("#weixinTip").css("display", "none");
                })
            }

            var code = getUrlParam("code");
            var dom = "<span>注册填写邀请码 <span id='copycode' style='color:red'>" + code + "</span> 得云币</span></br><span>可兑换精美好礼！</span><a data-clipboard-action='copy'  data-clipboard-target='#copycode' onclick='copy();' id='copy_btn'>点击复制</a>";
            if (code) {
                $("#code").append(dom);
            }

        });
        var isWeixin = is_weixin();
        var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight;
        var weixinTipt = $('<div id="weixinTip" style="display:none"><p><img src="live_weixin.png" alt="点击右上角，选择在浏览器中打开"/></p></div>');

        if (isWeixin) {
            $("body").append(weixinTipt);
        }

        $("#weixinTip").css({
            "position": "fixed",
            "left": "0",
            "top": "0",
            "height": winHeight,
            "width": "100%",
            "z-index": "1000",
            "background-color": "rgba(0,0,0,0.8)",
            "filter": "alpha(opacity=80)",
        });
        $("#weixinTip p").css({
            "text-align": "center",
            "margin-top": "10%",
            "padding-left": "5%",
            "padding-right": "5%"
        });
    </script>
</body>

</html>